<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>点击</button>
    <script>
        //每个函数都有this 环境对象 普通函数this指的是window
        //function fn(){console log(this)}
        //window.fn()
        const btn = document.querySelector('button')
        btn.addEventListener('click', function () {
            console.log(this);//btn对象
            //谁调用函数谁就是this
        })
    </script>
</body>

</html>